//
//  MacroConst.swift
//  SwiftDemo
//
//  Created by tenltrs on 2018/8/21.
//  Copyright © 2018年 Tenltrs. All rights reserved.
//

import Foundation
@_exported import SnapKit
@_exported import Then
@_exported import Reachability
@_exported import EmptyDataSet_Swift
@_exported import Alamofire
@_exported import XCGLogger
@_exported import IQKeyboardManagerSwift
@_exported import Reusable



let ScreenWidth = UIScreen.main.bounds.width
let ScreenHeight = UIScreen.main.bounds.height

//判断当前设备
let DEVICEPAD = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad)
let iPhoneX = (ScreenHeight == 812.0 || ScreenHeight == 896.0)
let iPhone6p = (ScreenHeight == 736.0)
let iPhone6 = (ScreenHeight == 667.0)
let iPhone5 = (ScreenHeight == 568.0)
let iPhone4 = (ScreenHeight == 480.0)


let SafeAreaInsets = UIEdgeInsets(top: iPhoneX ? 44 : 20, left: 0, bottom: iPhoneX ? 34 : 0, right: 0)

let NAVIGATIONBAR_TOP = UIApplication.shared.statusBarFrame.size.height
let NAV_HEIGHT = UINavigationController.init().navigationBar.frame.size.height
let NAVIGATIONBAR_HEIGHT = NAVIGATIONBAR_TOP + NAV_HEIGHT
let TABBAR_HEIGHT = UITabBarController.init().tabBar.frame.size.height + SafeAreaInsets.bottom

//image
let placeholderImage = UIImage(named: "defaultIcon")
let placeholderImageStr = "defaultIcon"

let RATIO = (ScreenWidth / 375) //基本比值

let Cell_ID = "Cell_ID"

let CURRENT_VC_KEY = "Current_Controller"

/// 存储男生版 还是女生版
let GenderKey = "GENDERKEY"

let App_Gender : Int! = (UserDefaults.standard.value(forKey: GenderKey) as? Int) ?? 1

/// 当前载入控制器
func CURRENT_VC() -> BaseViewController? {
    let curr = NSCacheTool.defaultCache().value(forKey: CURRENT_VC_KEY)
    var vc : BaseViewController? = nil
    if curr != nil{
        vc = curr as? BaseViewController
    }
    return vc
}

let UMAppKey = "5bd7c41ab465f567760000a4"
